package org.video.mine.entity;

import androidx.databinding.BaseObservable;
import androidx.databinding.Bindable;

public class ProgressLoadEntity extends BaseObservable {
    String set;
    String imgUrl;
    int allProgress;
    int loadProgress;
    boolean isLoading;
    String name;
    boolean edit = false;
    boolean isChecked = false;

    public boolean isChecked() {
        return isChecked;
    }

    public void setChecked(boolean checked) {
        isChecked = checked;
    }

    @Bindable
    public boolean isEdit() {
        return edit;
    }

    public void setEdit(boolean edit) {
        this.edit = edit;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Bindable
    public boolean isLoading() {
        return isLoading;
    }

    public void setLoading(boolean loading) {
        isLoading = loading;
    }

    @Bindable
    public String getSet() {
        return set;
    }

    public void setSet(String set) {
        this.set = set;
    }

    @Bindable
    public String getImgUrl() {
        return imgUrl;
    }

    public void setImgUrl(String imgUrl) {
        this.imgUrl = imgUrl;
    }

    @Bindable
    public int getAllProgress() {
        return allProgress;
    }

    public void setAllProgress(int allProgress) {
        this.allProgress = allProgress;
    }

    @Bindable
    public int getLoadProgress() {
        return loadProgress;
    }

    public void setLoadProgress(int loadProgress) {
        this.loadProgress = loadProgress;
    }

    @Bindable
    public String getNowProgress(){
        if (allProgress>0) {
            double pro = (loadProgress * 1.00) / (allProgress * 1.00) * 100;
            String format = String.format("%.2f", pro);
            return format + "%";
        }else {
            return "0.00%";
        }
    }
}
